#ifndef REGISTERFORM_H
#define REGISTERFORM_H

#include <QWidget>
#include <data/UserInfo.pb.h>
using namespace proto;
#include <module/basicwindows.h>

namespace Ui {
    class RegisterForm;
}

class RegisterForm : public BasicWindows {
    Q_OBJECT

public:
    explicit RegisterForm(QWidget* parent = nullptr);
    ~RegisterForm();
    data::Account& getAccount();

private:
    void init();

protected:
    void onVerifyVerificationCode(int code, QString message);
    void onSendVerificationCode(int code, QString message, QString timeout);

protected:
    void onRegisterButtonClicked();
    void onRegisterUser(int code, QString message, std::shared_ptr<data::UserInfo> info);

private slots:
    void on_btn_VerificationCode_clicked();

private:
    data::Account     account;
    bool              isVerification = false;
    bool              isSendVerification = false;
    Ui::RegisterForm* ui;
};

#endif  // REGISTERFORM_H
